<template>
  <Tabs :animated="false" @on-click="searchData(tab_index)" v-model="tab_index">
    <TabPane label="来访登记">
      <Row class="bench_search4">
        <Col span="4" offset="1">
          <span>事件名称：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
        <Col span="4" offset="1">
          <span>发生时间：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
        <Col span="4" offset="1">
          <span>事件发生人姓名：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
        <Col span="4" offset="1">
          <span>时间发生地点：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
        <Col span="4" offset="1">
          <span>登记人姓名：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
        <Col span="4" offset="1">
          <span>事件状态：</span>
          <Input style="width: 50%;" v-model="applyname" />
        </Col>
      </Row>

      <Button class="colBtn" size="large" type="primary">新增</Button>
      <Button class="colBtn" size="large" type="primary">编辑</Button>
      <Button class="colBtn" size="large" type="primary">删除</Button>
      <Button class="colBtn" size="large" type="primary">查看</Button>
      <Button class="colBtn" size="large" type="primary">已解决</Button>

      <Table style="margin-top: 20px;" border :columns="columns1" :data="data6"></Table>

      <Page :total="totalnum" :current="currentPageNo" :page-size="currentPageSize" @on-change="change" class="page_style" show-total  show-sizer @on-page-size-change="size"/>
      <Button @click="value1 = true" type="primary">Open</Button>
      <Drawer title="新增" :closable="false" v-model="value1">
          <p>7777777</p>
      </Drawer>
    </TabPane>

    <!-- <TabPane label="来访登记">
    </TabPane> -->

    <TabPane label="主动发现登记">
    </TabPane>

    <TabPane label="上级交办">
    </TabPane>
  </Tabs>

</template>

<script>
import { companyEventList } from '@/api/qstbV2'
export default {
  data () {
    return {
      theme2: 'light',
      totalnum: 0,
      value1: false,
      columns1: [
        { title: '序号', key: 'code', width: 150, align: 'center' },
        {
          title: '操作',
          key: 'action',
          width: 150,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h('Button', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  marginRight: '5px'
                },
                on: {
                  click: () => {
                    this.show(params.index)
                  }
                }
              }, '操作')
            ])
          }
        },
        { title: '事件发生人姓名', key: 'name', width: 150, align: 'center' },
        { title: '事件发生地点', key: 'name', width: 150, align: 'center' },
        { title: '发生事件', key: 'mobile', width: 150, align: 'center' },
        { title: '登记人身份证号', key: 'cardnoFilter', width: 202, align: 'center' },
        { title: '事件状态', key: 'process_name', width: 150, align: 'center' },
        { title: '解决方式', key: 'create_time', width: 150, align: 'center' },
        { title: '事件时间', key: 'time', width: 150, align: 'center' }
      ],
      data6: [
        {
          name: 'John Brown',
          age: 18,
          address: 'New York No. 1 Lake Park'
        },
        {
          name: 'Jim Green',
          age: 24,
          address: 'London No. 1 Lake Park'
        },
        {
          name: 'Joe Black',
          age: 30,
          address: 'Sydney No. 1 Lake Park'
        },
        {
          name: 'Jon Snow',
          age: 26,
          address: 'Ottawa No. 2 Lake Park'
        }
      ]
    }
  },
  mounted () {
    this.companyList()
  },
  methods: {
    show () {
      alert('hhhh')
    },
    companyList () {
      companyEventList().then(ret => {
        console.log(ret, 'shsshshshsh')
      })
    }
  }
}
</script>

<style scoped>
.bench_search4 {
    margin-bottom: 20px;
}
.ivu-col-offset-1 {
  margin-left: 0px;
}
.colBtn {
  width: 180px;
  margin-left: 6%;
}
</style>
